/**
 * Copyright 2011 By Shayne, Zhang.
 * 
 * The contents of this file are developped by Shayne, Zhang. You may visit:
 * http://www.shaynez.com for more details.
 *
 */
package com.shaynez.ec.element;

import com.shaynez.ec.Constants;
import com.shaynez.ec.exception.InvalidateValueException;

/**
 * @author shayne zhang
 *
 */
public class Compensation  {

	private double value;
	
	public static Compensation getInstance(double value) throws InvalidateValueException{
		if(value < Constants.THE_MIN_COMPENSATION_VALUE || value > Constants.THE_MAX_COMPENSATION_VALUE){
			throw new InvalidateValueException("Invalidate Compensation value > " + value);
		}
		return new Compensation(value);
	}
	
	private Compensation(double value){
		this.value = value;
	}
	
	public double getValue() {
		// TODO Auto-generated method stub
		return value;
	}


	public Factor getFactor() {
		// TODO Auto-generated method stub
		return new Factor(Math.pow(2,value));
	}

}
